package team.stride.database;

import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context;

public class UseDBExample {
	public static void addToDB1(Context ctx) {
		final ContentResolver cr = ctx.getContentResolver();
		final ContentValues values = new ContentValues();

		values.put(StrideDB.NAME_R, "first result");
		values.put(StrideDB.USERNAME_R, "gigel");
		values.put(StrideDB.TOPSPEED_R, 7.5);
		values.put(StrideDB.LENGTH_R, 3.45);
		values.put(StrideDB.TRACKNAME_R, "hardest");
		values.put(StrideDB.TIME_R, 123556);
		values.put(StrideDB.DATE_R, "hardest");
		values.put(StrideDB.LAPS_R, 100);
		values.put(StrideDB.DETAILS_R, "to be continued");
		cr.insert(StrideDB.CONTENT_URI_RESULTS, values);

		values.clear();
	}

	public static void addToDB2(Context ctx) {

		final ContentResolver cr = ctx.getContentResolver();
		final ContentValues values = new ContentValues();
		values.put(StrideDB.NAME_T, "first track");
		values.put(StrideDB.LENGTH_T, 5000);
		values.put(StrideDB.GPX_T, "long.gpx");
		values.put(StrideDB.DETAILS_T, "long long long");

		cr.insert(StrideDB.CONTENT_URI_TRACKS, values);
	}

	public static void clearResults(Context ctx) {
		final ContentResolver cr = ctx.getContentResolver();
		cr.delete(StrideDB.CONTENT_URI_RESULTS, null, null);
	}
}
